package com.diy.yuhaofilm.ui.activity

import android.os.Bundle
import android.view.View
import android.widget.ImageView
import androidx.core.view.ViewCompat
import androidx.core.view.ViewPropertyAnimatorListener
import com.diy.yuhaofilm.R
import com.diy.yuhaofilm.base.BaseActivity
import org.jetbrains.anko.find
import org.jetbrains.anko.startActivity

class SplashActivity : BaseActivity(),ViewPropertyAnimatorListener {
    val imageview by lazy { find<ImageView>(R.id.imageView) }


    override fun getLayoutId(): Int {
        return R.layout.activity_splash
    }

    override fun initData() {
        super.initData()
        imageview?.let { ViewCompat.animate(it).scaleX(1.0f).scaleY(1.0f).setListener(this).setDuration(1000) }
    }

    override fun onAnimationEnd(view: View?) {
        startActivity<MainActivity>()
        finish()

    }

    override fun onAnimationCancel(view: View?) {

    }

    override fun onAnimationStart(view: View?) {

    }

}